<template>
	<view class="my-layout">
		<view class="top-swiper">
			<u-swiper :list="list" mode="none" :effect3d="true" :circular="false" :autoplay="false" height="300" 
				@change='swiperChange'>
			</u-swiper>
			<view class="vip-bottom">
				<view v-if="currentIndex === currentVip" class="current-index">当前等级</view>
				<view class="vip-level">{{list[currentIndex].title}}{{'(VIP'+(currentIndex+1)+')'}}</view>
				<view class="vip-cash">
					<text v-if="currentIndex === currentVip">当前总资产</text>
					<text v-else>升到此等级总资产需达到{{list[currentIndex].cashClaim}}</text>
				</view>
			</view>
		</view>
		<!-- 会员权力 -->
		<view class="vip-right">
			<view class="vip-explain">尊敬的{{list[currentIndex].title}}, 您将专享以下专属特权</view>
			<view class="vip-num">
				<view class="item-num">
					<view class="">{{list[currentIndex].backNum}}</view>
					<view>购物返佣</view>
				</view>
				<view class="item-num">
					<view>{{list[currentIndex].shopAdds}}</view>
					<view>购物几率</view>
				</view>
			</view>
		</view>
		<view class="vip-proper">
			<view class="list-item">
				<view class="proper-item">
					<image class="proper-icon" src="/static/shop/amazon.png" mode="widthFix"></image>
					<image v-if="currentIndex < 0" class="proper-lock" src="/static/mine/lock.png" mode="widthFix"></image>
					<view class="proper-name">白银专属</view>
				</view>
				<view class="proper-item">
					<image class="proper-icon" src="/static/shop/amazon.png" mode="widthFix"></image>
					<image v-if="currentIndex < 1" class="proper-lock" src="/static/mine/lock.png" mode="widthFix"></image>
					<view class="proper-name">黄金专属</view>
				</view>
				<view class="proper-item">
					<image class="proper-icon" src="/static/shop/amazon.png" mode="widthFix"></image>
					<image v-if="currentIndex < 2" class="proper-lock" src="/static/mine/lock.png" mode="widthFix"></image>
					<view class="proper-name">铂金专属</view>
				</view>
			</view>	
			<view class="list-item">
				<view class="proper-item">
					<image class="proper-icon" src="/static/shop/amazon.png" mode="widthFix"></image>
					<image v-if="currentIndex < 3" class="proper-lock" src="/static/mine/lock.png" mode="widthFix"></image>
					<view class="proper-name">钻石专属</view>
				</view>
				<view class="proper-item">
					<image class="proper-icon" src="/static/shop/amazon.png" mode="widthFix"></image>
					<image v-if="currentIndex < 4" class="proper-lock" src="/static/mine/lock.png" mode="widthFix"></image>
					<view class="proper-name">皇冠专属</view>
				</view>
				<view class="proper-item">
					<image class="proper-icon" src="/static/shop/amazon.png" mode="widthFix"></image>
					<image v-if="currentIndex < 5" class="proper-lock" src="/static/mine/lock.png" mode="widthFix"></image>
					<view class="proper-name">至尊专属</view>
				</view>
			</view>
		</view>
		<view class="welfare-explain">
			<view class="">福利说明</view>
			<view class="">
				可以进入最低余额要求为{{list[currentIndex].cashClaim}}的天猫大厅，购物返佣为商品金额的{{list[currentIndex].backNum}}
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [
					{
						image: '/static/mine/ViP1.png',
						title: '白银会员',
						type: 1,
						backNum:'0.2%',
						shopAdds:'50%',
						cashClaim:'500.00'
					}, {
						image: '/static/mine/ViP2.png',
						title: '黄金会员',
						type: 2,
						backNum:'0.25%',
						shopAdds:'60%',
						cashClaim:'1000.00'
					}, {
						image: '/static/mine/ViP3.png',
						title: '铂金会员',
						type: 3,
						backNum:'0.3%',
						shopAdds:'80%',
						cashClaim:'1500.00'
					}, {
						image: '/static/mine/ViP4.png',
						title: '钻石会员',
						type: 4,
						backNum:'0.35%',
						shopAdds:'85%',
						cashClaim:'2000.00'
					}, {
						image: '/static/mine/ViP5.png',
						title: '皇冠会员',
						type: 5,
						backNum:'0.4%',
						shopAdds:'90%',
						cashClaim:'2500.00'
					}, {
						image: '/static/mine/ViP6.png',
						title: '至尊会员',
						type: 6,
						backNum:'0.5%',
						shopAdds:'100%',
						cashClaim:'5000.00'
					}, 
				],
				currentIndex:0 ,// 当前index
				currentVip:0
			}
		},
		methods: {
			swiperChange(index){
				console.log(index)
				this.currentIndex = index
			}
		}
	}
</script>

<style lang="scss" scoped>
.my-layout{
	border-top: 24rpx solid #F4F5F9;
	.top-swiper{
		position: relative;
		background-color: #FFFFFF;
		.vip-bottom{
			position: absolute;
			left: 70rpx;
			top: 30rpx;
			color: #FFFFFF;
			.current-index{
				width: 150rpx;
				height: 48rpx;
				line-height: 48rpx;
				padding: 0 20px 0 10rpx;
				font-size: 24rpx;
				background-color: #F59328;
				border-radius: 0 48px 48px 0;
			}
			.vip-level{
				font-size: 48rpx;
				line-height: 67rpx;
				margin-top: 30rpx;
				padding-left: 40rpx;
			}
			.vip-cash{
				font-size: 28rpx;
				height: 40rpx;
				line-height: 40rpx;
				margin-top: 30rpx;
				padding-left: 40rpx;
			}
		}
	}
	.vip-right{
		padding:25rpx 120rpx;
		background-color: #FFFFFF;
		.vip-explain{
			font-size: 28rpx;
			line-height: 40rpx;
			color: #666666;
		}
		.vip-num{
			margin-top:30rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
			.item-num{
				text-align: center;
				view:first-of-type{
					font-size: 56rpx;
					line-height: 66rpx;
					color: #FF3F45;
				}
				view:last-of-type{
					font-size: 24rpx;
					line-height: 33rpx;
					color: #000000;
				}
			}
		}
	}
	
	.vip-proper{
		margin: 10px 0;
		padding: 0rpx 65rpx 30rpx;
		background-color: #FFFFFF;
		.list-item{
			display: flex;
			justify-content: space-between;
			align-items: center;
		}
		.proper-item{
			position: relative;
			width: 120rpx;
			height: 165rpx;
			margin-top: 30rpx;
			.proper-icon{
				position: absolute;
				top: 0;
				left: 0;
				z-index: 10;
				width: 120rpx;
			}
			.proper-lock{
				position: absolute;
				top: 0;
				left: 0;
				z-index: 11;
				width: 120rpx;
			}
			.proper-name{
				position: absolute;
				left: 0;
				bottom: 0;
				font-size: 28rpx;
				color: #000000;
				line-height: 40rpx;
			}
		}
	}
	.welfare-explain{
		margin-top: 10rpx;
		padding: 27rpx 40rpx;
		background-color: #FFFFFF;
		view:first-of-type{
			font-size: 30rpx;
			color: #000000;
			line-height:42rpx;
		}
		view:last-of-type{
			font-size: 28rpx;
			color: #666666;
			line-height: 40rpx;
		}
	}
}
</style>
